﻿<?php

/*
 * action : applayabpay
 * param: user、password
 * return: uid、sex、money、rmb、coin、login_days、is_get、history[2] (total_win、total_lose)、total_borad、total_win、exp
 */

include_once("httpclient.php");
include_once('config.php');
$url_prefix = Config::$url_prefix;

$action = "ApplyABPay";

$param = array();
$param['channel'] = "11111";
$param['ua'] = "11111";
$param['imsi'] = '11111';
$param['imei'] = '1111';
$param['version'] = '1111';
$param['cid'] = '11';
$param['goodsid'] = 1;
$param['price'] = 6;
$param['pay_type'] = 1;
$param['user'] = "ttt";
$param['ipaddress'] = "dfsf";
$param['mac'] = "fsdf";


$query = array();
$query['action'] = $action;
$query['ver'] = Config::$ver;
$query['uid'] = 29;
$query['skey'] = 'ffffffffffffffffffffffffffffffffffff';
$query['param'] = json_encode($param);

$url = $url_prefix . http_build_query($query);
//返回数据
//{"ret":0,"desc":"","data":"transdata={"cporderid":"35049c8b25571232faf1d2e4","price":600,"cpprivateinfo":"cpprivateinfo123456","notifyurl":"http:\/\/127.0.0.1:9090\/zjhpay\/iappPayTrade.php","appuserid":"29","appid":"3001552896","waresid":1}&sign=XYA4IEyyAPRCTrWcems9p4F6Yp1JDNnXMIu6VBspDqd2oiY6JVLIk3MRbh3d/n9SOT9wEmFqYhH2GNxw6PTJq3XPjMry081D3hRRJGd8EQ8d30nH/0WUqxXF/FFW/J3m5kF1x1gNZCbsuvmfUDxHV9P9CVXc+eTTTK1tlsSiM2g=&signtype=RSA"}

//http://127.0.0.1:9090/zjhapi/api.php?action=ApplyABPay&ver=1.5.1&uid=29&skey=8b187d94b91e10ba5a263d5a8178b0ea&param={"version":"1111","goodsid":1,"price":6,"pay_type":1}
$client = new HttpClient();
echo "<pre />";
echo $client->get($url);
?>
